<ul class="list-group chat-list">
    {% for thread in threads %}
        <li class="list-group-item {% if not fos_message_is_read(thread) %}un-seen{% endif %}">
            <div class="media chat">
                <div class="media-left">
                    <a href="{{ path('user_view', {username: thread.lastMessage.sender.username}) }}">
                        <img class="media-object avatar" src="{{ asset(thread.lastMessage.sender.avatar)|imagine_filter('middle_square') }}">
                    </a>
                </div>
                <div class="media-body">
                    <div class="media-heading">
                        {{ thread.lastMessage.sender.username }}
                        <span class="meta pull-right">{{ thread.lastMessage.createdAt|time_diff }}</span>
                    </div>
                    <div class="body preview">
                        <a href="{{ url('fos_message_thread_view', {'threadId': thread.id}) }}#message_{{ thread.lastMessage.id }}">
                            {{ thread.lastMessage.body|striptags }}
                        </a>
                    </div>
                </div>
            </div>
        </li>
    {% else %}
        <li class="list-group-item empty-data">
            <i class="if i-envelope"></i> 还没有私信哟
        </li>
    {% endfor %}
</ul>